home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / elk-2_0.lha / elk-2.0 / doc / xlib / xlib.ms < prev    next >
Text File  |  1992-07-19  |  57KB  |  1,754 lines

  1. .so ../tmac/tmac.scheme
  2. .RP
  3. .TL
  4. Elk/Xlib Reference Manual
  5. .AU
  6. Oliver Laumann
  7. .
  8. .Ch Introduction
  9. .PP
  10. This document provides a list of the functions, special forms, and variables
  11. exported by the Elk Scheme/Xlib integration.
  12. Most of the functions are directly equivalent to a function of the
  13. Xlib C library, so that the description need not be repeated.
  14. In such cases, only the name of the corresponding Xlib function is
  15. mentioned.
  16. Thus, you should have the \f2Xlib \- C Language X Interface\fP
  17. manual within reach when using this reference manual.
  18. .PP
  19. The functions listed in this document can be loaded by evaluating
  20. the expression
  21. .DS
  22. .ft 5
  23. (require 'xlib).
  24. .ft
  25. .DE
  26. .Ix xlib
  27. in the interpreter's top level or in a Scheme program.
  28. .PP
  29. The types of arguments of the procedures listed below are not described
  30. when they are obvious from the context or from the name.
  31. For instance, an argument named \f2window\fP is always of type \f2window\fP,
  32. an argument named \f2atom\fP is an object of type \f2atom\fP, etc.
  33. Arguments the names of which end in ``?'' are always of type \f2boolean\fP.
  34. .PP
  35. If a function returns several items of the same type (for instance,
  36. a list of windows), the return value is a vector of objects of this type.
  37. If a function returns a collection of items of different types or
  38. of different semantics, the return value is a list of objects
  39. (or a pair).
  40. In this case, \f2multiple-value-bind\fP
  41. .Ix multiple-value-bind
  42. can be used to bind variables to the return values.
  43. .PP
  44. In the following, each description of a procedure, special form, or
  45. variable lists the kind of object in boldface.
  46. Here, \f3procedure\fP denotes either a primitive procedure or a
  47. compound procedure, \f3syntax\fP denotes a special form or a macro,
  48. and \f3variable\fP denotes a global variable that has some initial
  49. value and can be re-assigned a new value by the user (by means
  50. of \f2set!\fP or \f2fluid-let\fP).
  51. .
  52. .Ch Display Functions
  53. .
  54. .Pr display? x
  55. Returns #t iff \f2x\fP is an object of type \f2display\fP.
  56. .
  57. .Pr open-display . name-of-display
  58. See \f2XOpenDisplay\fP.
  59. \f2name-of-display\fP is a string or a symbol.
  60. If no name is specified, a NULL name will be passed to \f2XOpenDisplay\fP.
  61. .
  62. .Pr close-display display
  63. See \f2XCloseDisplay\fP.
  64. Finalizes all objects associated with the display, then closes
  65. the display.
  66. .
  67. .Pr display-default-root-window display
  68. .Up
  69. .Pr display-root-window display
  70. See \f2XDefaultRootWindow\fP.
  71. .
  72. .Pr display-default-colormap display
  73. .Up
  74. .Pr display-colormap display
  75. See \f2XDefaultColormap\fP.
  76. Returns the default colormap of the display's default screen.
  77. .
  78. .Pr display-default-gcontext display
  79. See \f2XDefaultGC\fP.
  80. Returns the default graphics context of the display's default screen.
  81. .
  82. .Pr display-default-depth display
  83. See \f2XDefaultDepth\fP.
  84. Returns the default depth of the display's default screen.
  85. .
  86. .Pr display-default-screen-number display
  87. See \f2XDefaultScreen\fP.
  88. Returns an integer.
  89. .
  90. .Pr display-cells display screen-number
  91. See \f2XDisplayCells\fP.
  92. Returns an integer.
  93. .
  94. .Pr display-planes display screen-number
  95. See \f2XDisplayPlanes\fP.
  96. Returns an integer.
  97. .
  98. .Pr display-string display
  99. See \f2XDisplayString\fP.
  100. Returns a string.
  101. .
  102. .Pr display-vendor display
  103. See \f2XServerVendor\fP, \f2XVendorRelease\fP.
  104. Returns a pair; the car is a string (the vendor identification),
  105. and the cdr is an integer (the vendor release number).
  106. .
  107. .Pr display-protocol-version display
  108. See \f2XProtocolVersion\fP, \f2XProtocolRevision\fP.
  109. Returns a pair of integers (the X protocol's major and minor version numbers).
  110. .
  111. .Pr display-screen-count display
  112. See \f2XScreenCount\fP.
  113. Returns an integer.
  114. .
  115. .Pr display-image-byte-order display
  116. See \f2XImageByteOrder\fP.
  117. Returns a symbol (\f5lsb-first\fP or \f5msb-first\fP).
  118. .
  119. .Pr display-bitmap-unit display
  120. See \f2XBitmapUnit\fP.
  121. Returns an integer.
  122. .
  123. .Pr display-bitmap-bit-order display
  124. See \f2XBitmapBitOrder\fP.
  125. Returns a symbol (\f5lsb-first\fP or \f5msb-first\fP).
  126. .
  127. .Pr display-bitmap-pad display
  128. See \f2XBitmapPad\fP.
  129. Returns an integer.
  130. .
  131. .Pr display-width display
  132. .Up
  133. .Pr display-height display
  134. See \f2XDisplayWidth\fP, \f2XDisplayHeight\fP.
  135. Returns the width/height of the display's default screen.
  136. .
  137. .Pr display-width-mm display
  138. .Up
  139. .Pr display-height-mm display
  140. See \f2XDisplayWidthMM\fP, \f2XDisplayHeightMM\fP.
  141. Returns the width/height of the display's default screen in millimeters.
  142. .
  143. .Pr display-motion-buffer-size display
  144. See \f2XDisplayMotionBufferSize\fP.
  145. Returns an integer.
  146. .
  147. .Pr display-flush-output display
  148. See \f2XFlush\fP.
  149. .
  150. .Pr display-wait-output display discard-events?
  151. See \f2XSync\fP.
  152. .
  153. .Pr no-op display
  154. See \f2XNoOp\fP.
  155. .
  156. .Pr list-depths display screen-number
  157. See \f2XListDepths\fP.
  158. Returns a vector of integers.
  159. .
  160. .Pr list-pixmap-formats display
  161. See \f2XListPixmapFormats\fP.
  162. Returns a vector of lists of three integers (depth, bits per pixel,
  163. and scanline pad).
  164. .
  165. .Pr set-after-function! display procedure
  166. See \f2XSetAfterFunction\fP.
  167. Returns the old after function.
  168. If \f2procedure\fP is #f, the current after function is disassociated
  169. from the display.
  170. .
  171. .Pr after-function display
  172. Returns the after function currently associated with the given
  173. display (#f if there is none).
  174. .
  175. .Pr synchronize display
  176. Sets the display's after function to \f2display-wait-output\fP.
  177. .
  178. .Ch Window Functions
  179. .
  180. .Pr window? x
  181. Returns #t iff \f2x\fP is an object of type \f2window\fP.
  182. .
  183. .Pr drawable? x
  184. Returns #t iff \f2x\fP is a ``drawable'' (window or pixmap).
  185. .
  186. .Pr window-display window
  187. Returns the display associated with the window.
  188. .
  189. .Pr window-unique-id window
  190. Returns a small integer uniquely identifying the given window.
  191. .
  192. .Pr create-window . args
  193. See \f2XCreateWindow\fP.
  194. This function is used to create a new window.
  195. .LP
  196. The number of arguments must be even.
  197. The 1st, 3rd, etc. argument is the name (a symbol) of an attribute
  198. to be set when the window is created, the 2nd, 4th, etc. argument
  199. is the corresponding value.
  200. The attributes can be specified in any order.
  201. .LP
  202. Attributes are \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP,
  203. \f2border\fP (each of which has an integer value), \f2parent\fP
  204. (the parent window), and all attributes that can be set by means
  205. of the \f5set-window-\fP\f2attribute\fP\f5!\fP functions below
  206. except \f2sibling\fP and \f2stack-mode\fP.
  207. The attributes \f2parent\fP, \f2width\fP, and \f2height\fP are
  208. mandatory.
  209. The default for \f2x\fP and \f2y\fP is 0, the default for
  210. \f2border\fP is 2.
  211. .
  212. .Pr set-window-x! window value
  213. .Up
  214. .Pr set-window-y! window value
  215. .Up
  216. .Pr set-window-width! window value
  217. .Up
  218. .Pr set-window-height! window value
  219. .Up
  220. .Pr set-window-border-width! window value
  221. .Up
  222. .Pr set-window-sibling! window value
  223. .Up
  224. .Pr set-window-stack-mode! window value
  225. .Up
  226. .Pr set-window-background-pixmap! window value
  227. .Up
  228. .Pr set-window-background-pixel! window value
  229. .Up
  230. .Pr set-window-border-pixmap! window value
  231. .Up
  232. .Pr set-window-border-pixel! window value
  233. .Up
  234. .Pr set-window-bit-gravity! window value
  235. .Up
  236. .Pr set-window-gravity! window value
  237. .Up
  238. .Pr set-window-backing-store! window value
  239. .Up
  240. .Pr set-window-backing-planes! window value
  241. .Up
  242. .Pr set-window-backing-pixel! window value
  243. .Up
  244. .Pr set-window-save-under! window value
  245. .Up
  246. .Pr set-window-event-mask! window value
  247. .Up
  248. .Pr set-window-do-not-propagate-mask! window value
  249. .Up
  250. .Pr set-window-override-redirect! window value
  251. .Up
  252. .Pr set-window-colormap! window value
  253. .Up
  254. .Pr set-window-cursor! window value
  255. See \f2XConfigureWindow\fP, \f2XChangeWindowAttributes\fP.
  256. Set the sibling window, stacking mode, background pixmap, background
  257. pixel, border pixel, cursor, and other attributes (see
  258. the \f5window-\fP functions below) of the specified window.
  259. .LP
  260. The stacking mode is a symbol (\f5above\fP, \f5below\fP, \f5top-if\fP,
  261. \f5bottom-if\fP, \f5opposite\fP).
  262. The \f2value\fP argument to \f2set-window-sibling!\fP must be a window,
  263. \f2set-window-background-pixmap!\fP expects a pixmap,
  264. \f2set-window-background-pixel!\fP and \f2set-window-border-pixel!\fP
  265. expect a pixel, and \f2set-window-cursor!\fP expects a cursor argument.
  266. For the types of the \f2value\fP argument of the other functions
  267. see the return values of the \f2window-\fP functions below.
  268. .
  269. .Pr window-x window
  270. .Up
  271. .Pr window-y window
  272. .Up
  273. .Pr window-width window
  274. .Up
  275. .Pr window-height window
  276. .Up
  277. .Pr window-border-width window
  278. .Up
  279. .Pr window-depth window
  280. .Up
  281. .Pr window-visual window
  282. .Up
  283. .Pr window-root window
  284. .Up
  285. .Pr window-class window
  286. .Up
  287. .Pr window-bit-gravity window
  288. .Up
  289. .Pr window-gravity window
  290. .Up
  291. .Pr window-backing-store window
  292. .Up
  293. .Pr window-backing-planes window
  294. .Up
  295. .Pr window-backing-pixel window
  296. .Up
  297. .Pr window-save-under window
  298. .Up
  299. .Pr window-colormap window
  300. .Up
  301. .Pr window-map-installed window
  302. .Up
  303. .Pr window-map-state window
  304. .Up
  305. .Pr window-all-event-masks window
  306. .Up
  307. .Pr window-your-event-mask window
  308. .Up
  309. .Pr window-do-not-propagate-mask window
  310. .Up
  311. .Pr window-override-redirect window
  312. .Up
  313. .Pr window-screen window
  314. See \f2XGetWindowAttributes\fP.
  315. Returns the x and y coordinates, width, height, border width,
  316. depth, visual, root window, class, bit gravity, window gravity,
  317. backing store availability, backing planes, backing pixel,
  318. save under availability, colormap, colormap installation information,
  319. map state, global event mask, local event mask, ``do-not-propagate'' mask,
  320. override redirect attribute, and screen of the specified window.
  321. .LP
  322. \f2window-visual\fP and \f2window-screen\fP always return the empty
  323. list in the current release of the software.
  324. \f2window-root\fP returns a window.
  325. \f2window-class\fP returns a symbol (\f5input-output\fP, \f5input-only\fP).
  326. \f2window-bit-gravity\fP returns a symbol (\f5forget\fP, \f5north-west\fP, 
  327. \f5north\fP, \f5north-east\fP, \f5west\fP, \f5center\fP, \f5east\fP, 
  328. \f5south-west\fP, \f5south\fP, \f5south-east\fP, \f5static\fP).
  329. \f2window-gravity\fP returns a symbol (same as \f2window-bit-gravity\fP
  330. with \f5unmap\fP instead of \f5forget\fP).
  331. \f2window-backing-store\fP returns a symbol (\f5not-useful\fP,
  332. \f5when-mapped\fP, \f5always\fP).
  333. \f2window-backing-planes\fP and \f2window-backing-pixel\fP return
  334. a pixel.
  335. \f2window-save-under\fP, \f2window-map-installed\fP and
  336. \f2window-override-redirect\fP return #t or #f.
  337. \f2window-colormap\fP returns a colormap.
  338. \f2window-map-state\fP returns a symbol (\f5unmapped\fP,
  339. \f5unviewable\fP, \f5viewable\fP).
  340. \f2window-all-event-masks\fP, \f2window-your-event-mask\fP, and
  341. \f2window-do-not-propagate-mask\fP return a list of symbols
  342. (event mask names such as \f5enter-window\fP, \f5pointer-motion\fP, etc.).
  343. All other functions return an integer.
  344. .
  345. .Pr drawable-root drawable
  346. .Up
  347. .Pr drawable-x drawable
  348. .Up
  349. .Pr drawable-y drawable
  350. .Up
  351. .Pr drawable-width drawable
  352. .Up
  353. .Pr drawable-height drawable
  354. .Up
  355. .Pr drawable-border-width drawable
  356. .Up
  357. .Pr drawable-depth drawable
  358. See \f2XGetGeometry\fP.
  359. Returns the root window, x and y coordinates, width, height,
  360. border width, and depth of the specified drawable.
  361. \f2drawable-root\fP returns a window, all other functions return
  362. an integer.
  363. .
  364. .Pr map-window window
  365. See \f2XMapWindow\fP.
  366. .
  367. .Pr unmap-window window
  368. See \f2XUnmapWindow\fP.
  369. .
  370. .Pr destroy-window window
  371. See \f2XDestroyWindow\fP.
  372. .
  373. .Pr destroy-subwindows window
  374. See \f2XDestroySubwindows\fP.
  375. .
  376. .Pr map-subwindows window
  377. See \f2XMapSubwindows\fP.
  378. .
  379. .Pr unmap-subwindows window
  380. See \f2XUnmapSubwindows\fP.
  381. .
  382. .Pr circulate-subwindows window direction
  383. See \f2XCirculateSubwindows\fP.
  384. \f2direction\fP is a symbol (\f5raise-lowest\fP or \f5lower-highest\fP).
  385. .
  386. .Pr clear-window window
  387. Performs a \f2clear-area\fP on the entire window.
  388. .
  389. .Pr raise-window window
  390. See \f2XRaiseWindow\fP.
  391. .
  392. .Pr lower-window window
  393. See \f2XLowerWindow\fP.
  394. .
  395. .Pr restack-windows list-of-windows
  396. See \f2XRestackWindows\fP.
  397. .
  398. .Pr query-tree window
  399. See\f2 XQueryTree\fP.
  400. Returns a list of three elements: root window, parent window, and
  401. children (a vector of windows).
  402. .Pr translate-coordinates src-window x y dst-window
  403. See \f2XTranslateCoordinates\fP.
  404. Returns a list of three elements: destination x and y, and child window.
  405. .
  406. .Pr query-pointer window
  407. See \f2XQueryPointer\fP.
  408. Returns a list of eight elements: x and y, a boolean indicating whether
  409. the pointer is on the same screen as the specified window, the root
  410. window, the root window's x and y coordinates, the child window,
  411. and a list of modifier names (see \f2grab-button\fP
  412. .Ix grab-button
  413. below).
  414. .
  415. .Ch Window Property and Selection Functions
  416. .
  417. .Pr atom? x
  418. Returns #t iff \f2x\fP is an object of type \f2atom\fP.
  419. .
  420. .Pr make-atom value
  421. Returns an atom with the given \f2value\fP.
  422. \f2value\fP is an integer.
  423. .
  424. .Pr intern-atom display name
  425. See \f2XInternAtom\fP.
  426. \f2name\fP is a string or a symbol.
  427. The atom is created if it does not yet exist.
  428. .
  429. .Pr find-atom display name
  430. See \f2XInternAtom\fP.
  431. \f2name\fP is a string or a symbol.
  432. If the atom does not exist, the symbol \f5none\fP is returned.
  433. .
  434. .Pr atom-name display atom
  435. See \f2XGetAtomName\fP.
  436. Returns a string.
  437. .
  438. .Pr list-properties window
  439. See \f2XListProperties\fP.
  440. Returns a vector of atoms.
  441. .
  442. .Pr get-property window property request-type offset length delete?
  443. See \f2XGetWindowProperty\fP.
  444. \f2property\fP is an object of type \f2atom\fP.
  445. \f2request-type\fP is an atom or #f in which case \f2AnyPropertyType\fP
  446. will be used.
  447. \f2offset\fP and \f2length\fP are integers.
  448. An error is signaled if \f2XGetWindowProperty\fP fails.
  449. .LP
  450. \f2get-property\fP returns a list of four items: the ``actual type''
  451. (an atom), the format (an integer), the data (if any, the empty list
  452. otherwise), and the number of bytes left (an integer).
  453. .LP
  454. The data returned is either a string (if the format indicates
  455. 8-bit data) or a vector of integers.
  456. .
  457. .Pr change-property window property type format mode data
  458. See \f2XChangeProperty\fP.
  459. \f2property\fP and \f2type\fP are atoms.
  460. \f2format\fP is an integer (8, 16, or 32).
  461. If \f2format\fP is 8 \f2data\fP must be a string, otherwise a vector of
  462. integers of the appropriate size.
  463. An error is signaled if the
  464. value of \f2format\fP is invalid or if \f2data\fP holds an integer
  465. that exceeds the size indicated by \f2format\fP.
  466. \f2mode\fP is a symbol (\f5replace\fP, \f5prepend\fP, or \f5append\fP).
  467. .
  468. .Pr delete-property window property
  469. See \f2XDeleteProperty\fP.
  470. .
  471. .Pr rotate-properties window vector-of-atoms delta
  472. See \f2XRotateWindowProperties\fP.
  473. \f2delta\fP is the amount to rotate (an integer).
  474. .
  475. .Pr set-selection-owner! display selection owner time
  476. See \f2XSetSelectionOwner\fP.
  477. \f2selection\fP is an atom; \f2owner\fP is a window; \f2time\fP is an
  478. integer or the symbol \f5now\fP (for \f2CurrentTime\fP).
  479. .
  480. .Pr selection-owner display selection
  481. See \f2XGetSelectionOwner\fP.
  482. .
  483. .Pr convert-selection selection target property requestor-window time
  484. See \f2XConvertSelection\fP.
  485. \f2selection\fP and \f2target\fP are atoms;
  486. \f2property\fP is an atom or the symbol \f5none\fP. 
  487. .
  488. .Ch Colormap Functions
  489. .
  490. .Pr color? x
  491. Returns #t iff \f2x\fP is an object of type \f2color\fP.
  492. .
  493. .Pr make-color r g b
  494. Returns an object of type \f2color\fP with the specified RGB components.
  495. \f2r\fP, \f2g\fP, and \f2b\fP are reals in the range 0.0 to 1.0.
  496. .
  497. .Pr color-rgb-values color
  498. Returns a list of three elements, the RGB components of the
  499. given color (see \f2make-color\fP
  500. .Ix make-color
  501. above).
  502. .
  503. .Pr query-color colormap pixel
  504. See \f2XQueryColor\fP.
  505. .
  506. .Pr query-colors colormap pixels
  507. See \f2XQueryColors\fP.
  508. \f2pixels\fP is a vector of pixels.
  509. Returns a vector of colors of the same size as \f2pixels\fP.
  510. .
  511. .Pr lookup-color colormap color-name
  512. See \f2XLookupColor\fP.
  513. \f2color-name\fP is a string or a symbol.
  514. Returns a pair of colors.
  515. .
  516. .Pr colormap? x
  517. Returns #t iff \f2x\fP is an object of type \f2colormap\fP.
  518. .
  519. .Pr colormap-display colormap
  520. Returns the display associated with the given colormap.
  521. .
  522. .Pr free-colormap colormap
  523. See \f2XFreeColormap\fP.
  524. .
  525. .Ch Pixel Functions
  526. .
  527. .Pr pixel? x
  528. Returns #t iff \f2x\fP is an object of type \f2pixel\fP.
  529. .
  530. .Pr pixel-value pixel
  531. Returns the value of the pixel as an unsigned integer.
  532. .
  533. .Pr black-pixel display
  534. .Up
  535. .Pr white-pixel display
  536. See \f2XBlackPixel\fP, \f2XWhitePixel\fP.
  537. Returns the black/white pixel of the display's default screen.
  538. .
  539. .Ch Pixmap Functions
  540. .
  541. .Pr pixmap? x
  542. Returns #t iff \f2x\fP is an object of type \f2pixmap\fP.
  543. .
  544. .Pr pixmap-display pixmap
  545. Returns the display associated with the pixmap.
  546. .
  547. .Pr free-pixmap pixmap
  548. See \f2XFreePixmap\fP.
  549. .
  550. .Pr create-pixmap drawable width height depth
  551. See \f2XCreatePixmap\fP.
  552. .
  553. .Pr create-bitmap-from-data window data width height
  554. See \f2XCreateBitmapFromData\fP.
  555. \f2data\fP is a string.
  556. \f5(* width height)\fP must not exceed the number of bits in \f2string\fP.
  557. .
  558. .Pr create-pixmap-from-bitmap-data win data width height foregrnd backgrnd depth
  559. See \f2XCreatePixmapFromBitmapData\fP.
  560. \f2data\fP is a string.
  561. \f5(* width height)\fP must not exceed the number of bits in \f2string\fP.
  562. .
  563. .Pr read-bitmap-file drawable filename
  564. See \f2XReadBitmapFile\fP.
  565. \f2filename\fP is a string or a symbol.
  566. If \f2XReadBitmapFile\fP signals an error, \f2read-bitmap-file\fP
  567. returns a symbol (\f5open-failed\fP, \f5file-invalid\fP, or \f5no-memory\fP).
  568. If it succeeds, \f2read-bitmap-file\fP returns a list of five elements:
  569. the bitmap (an object of type \f2pixmap\fP), the width and height of the
  570. bitmap, and the x and y coordinates of the hotspot.
  571. .
  572. .Pr write-bitmap-file filename pixmap width height x-hot y-hot
  573. See \f2XWriteBitmapFile\fP.
  574. \f2filename\fP is a string or a symbol.
  575. \f2x-hot\fP and \f2y-hot\fP are optional
  576. (\(mi1 is used if they are omitted), but either both or none of them
  577. must be given.
  578. \f2write-bitmap-file\fP returns a symbol (\f5success\fP, \f5open-failed\fP,
  579. \f5file-invalid\fP, or \f5no-memory\fP).
  580. .
  581. .Ch Graphics Context Functions
  582. .
  583. .Pr gcontext? x
  584. Returns #t iff \f2x\fP is an object of type \f2gcontext\fP.
  585. .
  586. .Pr gcontext-display gcontext
  587. Returns the display associated with the given GC.
  588. .
  589. .Pr create-gcontext . args
  590. See \f2XCreateGC\fP.
  591. This function is used to create a new GC.
  592. .LP
  593. The number of arguments must be even.
  594. The 1st, 3rd, etc. argument is the name (a symbol) of an attribute
  595. to be set when the graphics context is created, the 2nd, 4th, etc. argument
  596. is the corresponding value.
  597. The attributes can be specified in any order.
  598. .LP
  599. Attributes are \f2window\fP (mandatory) and all the attributes that can be
  600. set by the \f5set-gcontext-\fP\f2attribute\fP\f5!\fP functions
  601. below.
  602. .
  603. .Pr copy-gcontext gcontext window
  604. See \f2XCopyGC\fP.
  605. Returns a copy of \f2gcontext\fP (associated with the specified window).
  606. .
  607. .Pr free-gcontext gcontext
  608. See \f2XFreeGC\fP.
  609. .
  610. .Pr query-best-size display width height shape
  611. See \f2XQueryBestSize\fP.
  612. \f2shape\fP is a symbol (\f5cursor\fP, \f5tile\fP, or \f5stipple\fP).
  613. Returns a pair of integers (result width and result height).
  614. .
  615. .Pr query-best-cursor display width height
  616. .Up
  617. .Pr query-best-tile display width height
  618. .Up
  619. .Pr query-best-stipple display width height
  620. See \f2XQueryBestSize\fP.
  621. Invokes \f2query-best-size\fP with the given arguments and a shape
  622. of \f5cursor\fP, \f5tile\fP, or \f5stipple\fP, respectively.
  623. .
  624. .Pr gcontext-function gcontext
  625. .Up
  626. .Pr gcontext-plane-mask gcontext
  627. .Up
  628. .Pr gcontext-foreground gcontext
  629. .Up
  630. .Pr gcontext-background gcontext
  631. .Up
  632. .Pr gcontext-line-width gcontext
  633. .Up
  634. .Pr gcontext-line-style gcontext
  635. .Up
  636. .Pr gcontext-cap-style gcontext
  637. .Up
  638. .Pr gcontext-join-style gcontext
  639. .Up
  640. .Pr gcontext-fill-style gcontext
  641. .Up
  642. .Pr gcontext-fill-rule gcontext
  643. .Up
  644. .Pr gcontext-arc-mode gcontext
  645. .Up
  646. .Pr gcontext-tile gcontext
  647. .Up
  648. .Pr gcontext-stipple gcontext
  649. .Up
  650. .Pr gcontext-ts-x gcontext
  651. .Up
  652. .Pr gcontext-ts-y gcontext
  653. .Up
  654. .Pr gcontext-subwindow-mode gcontext
  655. .Up
  656. .Pr gcontext-exposures gcontext
  657. .Up
  658. .Pr gcontext-clip-x gcontext
  659. .Up
  660. .Pr gcontext-clip-y gcontext
  661. .Up
  662. .Pr gcontext-dash-offset gcontext
  663. See \f2XGetGCValues\fP.
  664. Returns the 
  665. logical operation, plane mask, foreground and background pixel
  666. value, line width and style, cap and join style, fill style and rule,
  667. arc mode, tiling and stippling pixmap, tiling x- and y-origin,
  668. subwindow mode, clipping x- and y-origin, and dashed line
  669. information of the specified graphics context.
  670. .LP
  671. \f2gcontext-function\fP returns a symbol
  672. (\f5clear\fP, \f5and\fP, \f5and-reverse\fP, \f5copy\fP, \f5and-inverted\fP,
  673. \f5no-op\fP, \f5xor\fP, \f5or\fP, \f5nor\fP, \f5equiv\fP, \f5invert\fP,
  674. \f5or-reverse\fP, \f5copy-inverted\fP, \f5nand\fP, or \f5set\fP).
  675. \f2gcontext-plane-mask\fP, \f2gcontext-foreground\fP,
  676. and \f2gcontext-background\fP return a pixel.
  677. \f2gcontext-tile\fP and \f2gcontext-stipple\fP return a pixmap.
  678. The line style is a symbol (\f5solid\fP, \f5dash\fP, \f5double-dash\fP);
  679. the cap style is a symbol (\f5not-last\fP, \f5butt\fP, \f5round\fP,
  680. \f5projecting\fP); the join style is a symbol (\f5miter\fP, \f5round\fP,
  681. \f5bevel\fP); the fill style is a symbol (\f5solid\fP, \f5tiled\fP,
  682. \f5stippled\fP, \f5opaque-stippled\fP); the fill rule is a symbol
  683. (\f5even-odd\fP, \f5winding\fP); the arc mode is a symbol (\f5chord\fP,
  684. \f5pie-slice\fP); the subwindow-mode is a symbol
  685. (\f5clip-by-children\fP, \f5include-inferiors\fP).
  686. \f2gcontext-exposures\fP returns a boolean.
  687. All other functions return an integer.
  688. .
  689. .Pr set-gcontext-function! gcontext value
  690. .Up
  691. .Pr set-gcontext-plane-mask! gcontext value
  692. .Up
  693. .Pr set-gcontext-foreground! gcontext value
  694. .Up
  695. .Pr set-gcontext-background! gcontext value
  696. .Up
  697. .Pr set-gcontext-line-width! gcontext value
  698. .Up
  699. .Pr set-gcontext-line-style! gcontext value
  700. .Up
  701. .Pr set-gcontext-cap-style! gcontext value
  702. .Up
  703. .Pr set-gcontext-join-style! gcontext value
  704. .Up
  705. .Pr set-gcontext-fill-style! gcontext value
  706. .Up
  707. .Pr set-gcontext-fill-rule! gcontext value
  708. .Up
  709. .Pr set-gcontext-arc-mode! gcontext value
  710. .Up
  711. .Pr set-gcontext-tile! gcontext value
  712. .Up
  713. .Pr set-gcontext-stipple! gcontext value
  714. .Up
  715. .Pr set-gcontext-ts-x! gcontext value
  716. .Up
  717. .Pr set-gcontext-ts-y! gcontext value
  718. .Up
  719. .Pr set-gcontext-font! gcontext value
  720. .Up
  721. .Pr set-gcontext-subwindow-mode! gcontext value
  722. .Up
  723. .Pr set-gcontext-exposures! gcontext value
  724. .Up
  725. .Pr set-gcontext-clip-x! gcontext value
  726. .Up
  727. .Pr set-gcontext-clip-y! gcontext value
  728. .Up
  729. .Pr set-gcontext-clip-mask! gcontext value
  730. .Up
  731. .Pr set-gcontext-dash-offset! gcontext value
  732. See \f2XChangeGC\fP.
  733. Sets the logical operation, plane mask, foreground and background pixel
  734. value, line width and style, cap and join style, fill style and rule,
  735. arc mode, tiling and stippling pixmap, tiling x- and y-origin, font,
  736. subwindow mode, clipping x- and y-origin, clipping bitmap, and dashed line
  737. information for the specified graphics context.
  738. .LP
  739. The \f2value\fP argument to \f2set-gcontext-font!\fP is a font,
  740. and the \f2value\fP argument to \f2set-gcontext-clip-mask!\fP
  741. is a pixmap.
  742. For the types of the \f2value\fP argument of the other functions
  743. see the return values of the \f2gcontext-\fP functions above.
  744. .
  745. .Pr set-gcontext-clip-rectangles! gcontext x y rectangles ordering
  746. See \f2XSetClipRectangles\fP.
  747. \f2x\fP and \f2y\fP are integers (the coordinates of the clip-mask origin).
  748. \f2rectangles\fP is a vector of lists of four integers (x, y, width,
  749. and height of each rectangle).
  750. \f2ordering\fP is a symbol (\f5unsorted\fP, \f5y-sorted\fP, \f5yx-sorted\fP,
  751. or \f5yx-banded\fP).
  752. .
  753. .Pr set-gcontext-dashlist! gcontext dash-offset dash-list
  754. See \f2XSetDashes\fP.
  755. \f2dash-offset\fP is an integer.
  756. \f2dash-list\fP is a vector of integers between 0 and 255.
  757. .
  758. .Ch Graphics Functions
  759. .
  760. .Pr clear-area window x y width height exposures?
  761. See \f2XClearArea\fP.
  762. .
  763. .Pr copy-area src-drawable gcontext src-x src-y width height dst-drawable "dst-x dst-y"
  764. See \f2XCopyArea\fP.
  765. .
  766. .Pr copy-plane src-drawable gcontext plane src-x src-y width height "dst-drawable dst-x dst-y"
  767. See \f2XCopyPlane\fP.
  768. \f2plane\fP is an integer.
  769. An error is signaled unless exactly one bit is set in \f2plane\fP.
  770. .
  771. .Pr draw-point drawable gcontext x y
  772. See \f2XDrawPoint\fP.
  773. .
  774. .Pr draw-points drawable gcontext vector-of-points relative?
  775. See \f2XDrawPoints\fP.
  776. \f2vector-of-points\fP is a vector of pairs consisting of two integers
  777. (the x and y coordinates).
  778. If \f2relative?\fP is #t, \f2CoordModePrevious\fP
  779. is passed to \f2XDrawPoints\fP, otherwise \f2CoordModeOrigin\fP is used.
  780. .
  781. .Pr draw-line drawable gcontext x1 y1 x2 y2
  782. See \f2XDrawLine\fP.
  783. .
  784. .Pr draw-lines drawable gcontext vector-of-points relative?
  785. See \f2XDrawLines\fP.
  786. See \f2draw-points\fP
  787. .Ix draw-points
  788. above.
  789. .
  790. .Pr draw-segments drawable gcontext vector-of-points
  791. See \f2XDrawSegments\fP.
  792. \f2vector-of-points\fP is a vector of lists of four integers
  793. (x1, y1, x2, and y2).
  794. .
  795. .Pr draw-rectangle drawable gcontext x y width height
  796. See \f2XDrawRectangle\fP.
  797. .
  798. .Pr fill-rectangle drawable gcontext x y width height
  799. See \f2XFillRectangle\fP.
  800. .
  801. .Pr draw-rectangles drawable gcontext vector-of-rectangles
  802. See \f2XDrawRectangles\fP.
  803. \f2vector-of-rectangles\fP is a vector of lists of four integers
  804. (x, y, width, and height of each rectangle).
  805. .
  806. .Pr fill-rectangles drawable gcontext vector-of-rectangles
  807. See \f2XFillRectangles\fP.
  808. See \f2draw-rectangles\fP
  809. .Ix draw-rectangles
  810. above.
  811. .
  812. .Pr draw-arc drawable gcontext x y width height angle1 angle2
  813. See \f2XDrawArc\fP.
  814. .
  815. .Pr fill-arc drawable gcontext x y width height angle1 angle2
  816. See \f2XFillArc\fP.
  817. .
  818. .Pr draw-arcs drawable gcontext vector-of-data
  819. See \f2XDrawArcs\fP.
  820. \f2vector-of-data\fP is a vector of lists of six integers
  821. (x, y, width, height, angle1, and angle2).
  822. .
  823. .Pr fill-arcs drawable gcontext vector-of-data
  824. See \f2XFillArcs\fP.
  825. See \f2draw-arcs\fP
  826. .Ix draw-arcs
  827. above.
  828. .
  829. .Pr fill-polygon drawable gcontext vector-of-points relative? shape
  830. See \f2XFillPolygon\fP.
  831. See \f2draw-points\fP
  832. .Ix draw-points
  833. above.
  834. \f2shape\fP is a symbol (\f5complex\fP, \f5non-convex\fP, or \f5convex\fP).
  835. .
  836. .Ch Font Functions
  837. .
  838. .Pr font? x
  839. Returns #t iff \f2x\fP is an object of type \f2font\fP.
  840. .
  841. .Pr font-display
  842. Returns the display associated with the given font.
  843. .
  844. .Pr open-font display font-name
  845. See \f2XLoadQueryFont\fP.
  846. \f2font-name\fP is a string or a symbol.
  847. .
  848. .Pr close-font font
  849. See \f2XUnloadFont\fP.
  850. .
  851. .Pr font-name font
  852. Returns the name of the specified font (a string) or #f if the name could
  853. not be determined (e.g. when the font has been obtained by a call
  854. to \f2gcontext-font\fP).
  855. .
  856. .Pr gcontext-font gcontext
  857. Calls \f2XQueryFont\fP with the GC obtained by \f2XGContextFromGC\fP.
  858. Only a limited number of functions can be applied to a font
  859. returned by \f2gcontext-font\fP, since it has neither a name nor
  860. a font-ID.
  861. .
  862. .Pr list-font-names display pattern
  863. See \f2XListFonts\fP.
  864. \f2pattern\fP is a string or a symbol.
  865. Returns a vector of font names (strings).
  866. .
  867. .Pr list-fonts display pattern
  868. See \f2XListFontsWithInfo\fP.
  869. \f2pattern\fP is a string or a symbol.
  870. Returns a vector of fonts.
  871. These fonts are ``pseudo fonts'' which do not have a font-ID.
  872. A pseudo font is loaded automatically and turned into a ``real''
  873. font the first time it is passed to a function that makes use
  874. of the font-ID.
  875. .
  876. .Pr font-direction font
  877. .Up
  878. .Pr font-min-byte2 font
  879. .Up
  880. .Pr font-max-byte2 font
  881. .Up
  882. .Pr font-min-byte1 font
  883. .Up
  884. .Pr font-max-byte1 font
  885. .Up
  886. .Pr font-all-chars-exist? font
  887. .Up
  888. .Pr font-default-char font
  889. .Up
  890. .Pr font-ascent font
  891. .Up
  892. .Pr font-descent font
  893. These functions return the font direction as a symbol (\f5left-to-right\fP
  894. or \f5right-to-left\fP), the first and last character (as an integer),
  895. the first and last row (integer), an indication whether all characters
  896. have non-zero size (boolean), the default character (integer), and the
  897. ascent and descent (integer) of the specified font.
  898. .
  899. .Pr char-rbearing font index
  900. .Up
  901. .Pr char-lbearing font index
  902. .Up
  903. .Pr char-width font index
  904. .Up
  905. .Pr char-ascent font index
  906. .Up
  907. .Pr char-descent font index
  908. These functions return the metrics of
  909. the character specified by the integer \f2index\fP of the given font.
  910. Each function returns an integer.
  911. \f2font\fP can be a 1-byte as well as a 2-byte font.
  912. .
  913. .Pr max-char-lbearing font
  914. .Up
  915. .Pr max-char-rbearing font
  916. .Up
  917. .Pr max-char-width font
  918. .Up
  919. .Pr max-char-ascent font
  920. .Up
  921. .Pr max-char-descent font
  922. These functions return the maximum metrics over all characters
  923. in the specified font.
  924. Each function returns an integer.
  925. .
  926. .Pr min-char-lbearing font
  927. .Up
  928. .Pr min-char-rbearing font
  929. .Up
  930. .Pr min-char-width font
  931. .Up
  932. .Pr min-char-ascent font
  933. .Up
  934. .Pr min-char-descent font
  935. These functions return the minimum metrics over all characters
  936. in the specified font.
  937. Each function returns an integer.
  938. .
  939. .Pr font-properties font
  940. Returns a vector of font properties; each element of the vector
  941. is a pair consisting of the property name (an atom) and an
  942. unsigned integer (the value of the property).
  943. .
  944. .Pr font-property font property-name
  945. Returns the value of the specified property associated with the
  946. specified font.
  947. \f2property-name\fP is a string or a symbol.
  948. .
  949. .Pr font-path display
  950. See \f2XGetFontPath\fP.
  951. Returns the current font path as a vector of strings.
  952. .
  953. .Pr set-font-path! display path
  954. See \f2XSetFontPath\fP.
  955. \f2path\fP is a list; each element is a string or a symbol.
  956. .
  957. .Ch Text Metrics and Text Drawing Functions
  958. .
  959. .Pr text-width font text format
  960. See \f2XTextWidth\fP, \f2XTextWidth16\fP.
  961. \f2format\fP indicates whether 8-bit or 16-bit text is used; it is either
  962. the symbol \f51-byte\fP or the symbol \f52-byte\fP.
  963. \f2text\fP is a vector of integers; the integers must not exceed the
  964. size indicated by the format.
  965. .
  966. .Pr extents-lbearing font text format
  967. .Up
  968. .Pr extents-rbearing font text format
  969. .Up
  970. .Pr extents-width font text format
  971. .Up
  972. .Pr extents-ascent font text format
  973. .Up
  974. .Pr extents-descent font text format
  975. See \f2XTextExtents\fP, \f2XTextExtents16\fP.
  976. These functions are used to compute the overall metrics of an 8-bit
  977. or 16-bit character string.
  978. Each function returns an integer.
  979. For the format of \f2text\fP and \f2format\fP see \f2text-width\fP
  980. .Ix text-width
  981. above.
  982. .
  983. .Pr draw-image-text drawable gcontext x y text format
  984. See \f2XDrawImageString\fP, \f2XDrawImageString16\fP.
  985. See \f2text-width\fP
  986. .Ix text-width
  987. above.
  988. .
  989. .Pr draw-poly-text drawable gcontext x y text format
  990. See \f2XDrawText\fP, \f2XDrawText16\fP.
  991. See \f2text-width\fP
  992. .Ix text-width
  993. above.
  994. \f2text\fP is a vector of integers with intermixed objects of type \f2font\fP.
  995. .
  996. .Pr translate-text string
  997. Converts the string into a representation suitable as an argument
  998. to \f2text-width\fP, \f2draw-image-text\fP, or \f2draw-poly-text\fP
  999. (a vector of integers obtained by applying \f2char\(mi>integer\fP
  1000. to the characters of the string argument).
  1001. .
  1002. .Ch Cursor Functions
  1003. .
  1004. .Pr cursor? x
  1005. Returns #t iff \f2x\fP is an object of type \f2cursor\fP.
  1006. .
  1007. .Pr cursor-display cursor
  1008. Returns the display associated with the given cursor.
  1009. .
  1010. .Pr free-cursor
  1011. See \f2XFreeCursor\fP.
  1012. .
  1013. .Pr create-cursor src mask x y foreground background
  1014. See \f2XCreatePixmapCursor\fP.
  1015. \f2src\fP and \f2mask\fP are pixmaps.
  1016. \f2mask\fP can be the symbol \f5none\fP.
  1017. .
  1018. .Pr create-glyph-cursor src src-char mask mask-char foreground background
  1019. See \f2XCreateGlyphCursor\fP.
  1020. \f2src\fP and \f2mask\fP are fonts.
  1021. \f2mask\fP can be the symbol \f5none\fP.
  1022. The display is obtained from \f2src\fP.
  1023. \f2src-char\fP and \f2mask-char\fP are integers.
  1024. .
  1025. .Pr create-font-cursor display src-char
  1026. See \f2XCreateGlyphCursor\fP.
  1027. Calls \f2create-glyph-cursor\fP with the font named ``cursor'', the
  1028. specified \f2src-char\fP, a \f2mask-char\fP of \f5(1+ src-char)\fP,
  1029. black foreground, and white background.
  1030. .
  1031. .Pr recolor-cursor cursor foreground background
  1032. See \f2XRecolorCursor\fP
  1033. .
  1034. .Pr define-cursor window cursor
  1035. Synonym for \f5(set-window-cursor! window cursor)\fP.
  1036. .
  1037. .Pr undefine-cursor window
  1038. Synonym for \f5(set-window-cursor! window 'none)\fP.
  1039. .
  1040. .Ch Grab Functions
  1041. .
  1042. .Pr grab-pointer window owner? events ptr-sync? kbd-sync? confine-to cursor time
  1043. See \f2XGrabPointer\fP.
  1044. \f2window\fP and \f2confine-to\fP are windows.
  1045. \f2events\fP is a list of symbols (event mask names, such as \f5enter-window\fP,
  1046. \f5pointer-motion\fP, etc.).
  1047. \f2ptr-sync?\fP and \f2kbd-sync?\fP determine whether synchronous
  1048. or asynchronous grab mode is to be used.
  1049. \f2time\fP is an integer or the symbol \f5now\fP (for \f2CurrentTime\fP).
  1050. \f2grab-pointer\fP returns a symbol (\f5success\fP, \f5not-viewable\fP,
  1051. \f5already-grabbed\fP, \f5frozen\fP, or \f5invalid-time\fP).
  1052. .
  1053. .Pr ungrab-pointer display time
  1054. See \f2XUngrabPointer\fP.
  1055. .
  1056. .Pr grab-button win button mod owner? events ptr-sync? kbd-sync? "confine-to cursor"
  1057. See \f2XGrabButton\fP.
  1058. \f2button\fP is a symbol (\f5button1\fP .. \f5button5\fP, or \f5any-button\fP).
  1059. \f5mod\fP (modifiers) is a list of symbols (\f5shift\fP, \f5lock\fP,
  1060. \f5control\fP, \f5mod1\fP .. \f5mod5\fP, \f5button1\fP .. \f5button5\fP,
  1061. or \f5any-modifier\fP).
  1062. For the other arguments see \f2grab-pointer\fP
  1063. .Ix grab-pointer
  1064. above.
  1065. .
  1066. .Pr ungrab-button window button modifiers
  1067. See \f2XUngrabButton\fP.
  1068. See \f2grab-button\fP
  1069. .Ix grab-button
  1070. above.
  1071. .
  1072. .Pr change-active-pointer-grab display events cursor time
  1073. See \f2XChangeActivePointerGrab\fP.
  1074. \f2events\fP is a list of symbols (event mask names, such as \f5enter-window\fP,
  1075. \f5pointer-motion\fP, etc.).
  1076. .
  1077. .Pr grab-keyboard window owner? pointer-sync? keyboard-sync? time
  1078. See \f2XGrabKeyboard\fP.
  1079. For a description of the arguments and the return value see \f2grab-pointer\fP
  1080. .Ix grab-pointer
  1081. above.
  1082. .
  1083. .Pr ungrab-keyboard display time
  1084. See \f2XUngrabKeyboard\fP.
  1085. .
  1086. .Pr grab-key window key modifiers owner? pointer-sync? keyboard-sync?
  1087. See \f2XGrabKey\fP.
  1088. \f2key\fP is a keycode (an integer) or the symbol \f5any\fP.
  1089. For the other arguments see \f2grab-pointer\fP
  1090. .Ix grab-pointer
  1091. above.
  1092. .
  1093. .Pr ungrab-key window key modifiers
  1094. See \f2XUngrabKey\fP.
  1095. See \f2grab-key\fP
  1096. .Ix grab-key
  1097. above.
  1098. .
  1099. .Pr allow-events display mode time
  1100. See \f2XAllowEvents\fP.
  1101. \f2mode\fP is a symbol (\f5async-pointer\fP, \f5sync-pointer\fP,
  1102. \f5replay-pointer\fP, \f5async-keyboard\fP, \f5sync-keyboard\fP,
  1103. \f5replay-keyboard\fP, \f5async-both\fP, or \f5sync-both\fP).
  1104. .
  1105. .Pr grab-server display
  1106. See \f2XGrabServer\fP.
  1107. .
  1108. .Pr ungrab-server display
  1109. See \f2XUngrabServer\fP.
  1110. .
  1111. .Sy with-server-grabbed display . body-forms
  1112. This macro performs a \f2grab-server\fP on the specified display,
  1113. evaluates the \f2body-forms\fP in order, and then ungrabs the server.
  1114. The macro body is guarded by a \f2dynamic-wind\fP to ensure that the
  1115. \f2ungrab-server\fP is performed when a body-form calls a continuation
  1116. created outside the macro, and that it is grabbed again when
  1117. the body is re-entered at a later point in time.
  1118. \f2with-server-grabbed\fP returns the value of the last body-form.
  1119. .
  1120. .Ch Window Manager Functions
  1121. .
  1122. .Pr reparent-window window parent-window x y
  1123. See \f2XReparentWindow\fP.
  1124. .
  1125. .Pr install-colormap colormap
  1126. See \f2XInstallColormap\fP.
  1127. .
  1128. .Pr uninstall-colormap colormap
  1129. See \f2XUninstallColormap\fP.
  1130. .
  1131. .Pr list-installed-colormaps window
  1132. See \f2XListInstalledColormaps\fP.
  1133. Returns a vector of colormaps.
  1134. .
  1135. .Pr set-input-focus display window revert-to time
  1136. See \f2XSetInputFocus\fP.
  1137. \f2window\fP can be the symbol \f5pointer-root\fP.
  1138. \f2revert-to\fP is a symbol (\f5none\fP, \f5pointer-root\fP, or \f5parent\fP).
  1139. \f2time\fP is an integer or the symbol \f5now\fP.
  1140. .
  1141. .Pr input-focus display
  1142. See \f2XGetInputFocus\fP.
  1143. Returns a pair the car of which is a window, and the cdr is a symbol
  1144. (\f5none\fP, \f5pointer-root\fP, or \f5parent\fP).
  1145. .
  1146. .Pr general-warp-pointer display dst-win dst-x dst-y src-win src-x src-y "src-width src-height"
  1147. See \f2XWarpPointer\fP.
  1148. .
  1149. .Pr warp-pointer dst-window dst-x dst-y
  1150. See \f2XWarpPointer\fP.
  1151. Invokes \f2general-warp-pointer\fP with the display associated with the
  1152. \f2dst-window\fP, the \f2dst-window\fP, \f2dst-x\fP, \f2dst-y\fP,
  1153. a \f2src-window\fP of \f5none\fP, and zero source coordinates and dimensions.
  1154. .
  1155. .Pr warp-pointer-relative display x-offset y-offset
  1156. See \f2XWarpPointer\fP.
  1157. Invokes \f2general-warp-pointer\fP with the specified \f2display\fP,
  1158. a \f2dst-window\fP of \f5none\fP, \f2x-offset\fP, \f2y-offset\fP,
  1159. a \f2src-window\fP of \f5none\fP, and zero source coordinates and dimensions.
  1160. .
  1161. .Pr bell display . percent
  1162. See \f2XBell\fP.
  1163. \f2percent\fP is an integer between -100 and 100.
  1164. If \f2percent\fP is omitted, 0 is used.
  1165. .
  1166. .Pr set-access-control display enable?
  1167. See \f2XSetAccessControl\fP.
  1168. .
  1169. .Pr change-save-set window mode
  1170. See \f2XChangeSaveSet\fP.
  1171. \f2mode\fP is a symbol (\f5insert\fP or \f5delete\fP).
  1172. .
  1173. .Pr set-close-down-mode display mode
  1174. See \f2XSetCloseDownMode\fP.
  1175. \f2mode\fP is a symbol (\f5destroy-all\fP, \f5retain-permanent\fP,
  1176. or \f5retain-temporary\fP).
  1177. .
  1178. .Pr get-pointer-mapping display
  1179. See \f2XGetPointerMapping\fP.
  1180. Returns a vector of 256 integers.
  1181. .
  1182. .Pr set-pointer-mapping display mapping
  1183. See \f2XSetPointerMapping\fP.
  1184. \f2mapping\fP is a vector of integers.
  1185. Returns #t if \f2XSetPointerMapping\fP succeeds, #f otherwise.
  1186. .
  1187. .Ch Event Handling Functions
  1188. .
  1189. .Pr event-listen display wait?
  1190. See \f2XPending\fP, \f2XPeekEvent\fP.
  1191. Returns the size of the display's event queue.
  1192. If \f2wait?\fP is true and the event queue is empty, \f2event-listen\fP
  1193. flushes the output buffer and blocks until an event is received from
  1194. the server.
  1195. .
  1196. .Pr get-motion-events window from-time to-time
  1197. See \f2XGetMotionEvents\fP.
  1198. \f2from-time\fP and \f2to-time\fP are integers or the symbol \f5now\fP.
  1199. \f2get-motion-events\fP returns a vector of lists of three elements:
  1200. a time stamp (an integer or the symbol \f5now\fP), and the x and y 
  1201. coordinates (integers).
  1202. .
  1203. .Sy handle-events display discard? peek? . clauses
  1204. See \f2XNextEvent\fP, \f2XPeekEvent\fP, \f2XIfEvent\fP, \f2XPeekIfEvent\fP.
  1205. \f2handle-events\fP is a special form.
  1206. Each \f2clause\fP is of the form \f2(guard function)\fP; \f2guard\fP
  1207. is either an event name (a symbol, e.g. \f5key-press\fP or \f5exposure\fP),
  1208. a list of event names, or the symbol \f5else\fP.
  1209. \f2handle-events\fP gets the next event from the specified display.
  1210. Then the event type is matched against each event name in each guard
  1211. in order.
  1212. When a match occurs, the corresponding function is invoked with
  1213. the name of the event being dispatched (a symbol) and other, event
  1214. specific arguments (see below).
  1215. When no clause matches and an \f5else\fP clause is present, the function
  1216. from this clause is invoked.
  1217. \f2handle-events\fP loops until a function returns a value not
  1218. equal to #f in which case handle-events returns this value.
  1219. .LP
  1220. If \f2discard?\fP is true, unprocessed events (i.\|e. events for which
  1221. no matching clause has been found) are removed from the event queue,
  1222. otherwise they are left in place.
  1223. If \f2peek?\fP is true, processed events are not removed from
  1224. the event queue.
  1225. .LP
  1226. The following list gives all event specific arguments for each
  1227. event type.
  1228. The first argument is always the event type (a symbol).
  1229. .LP
  1230. In the following list, arguments with names of the form
  1231. \f2something-window\fP (or simply \f2window\fP) are always of type
  1232. \f2window\fP;
  1233. arguments with names of the form \f2something-atom\fP (or simply \f2atom\fP)
  1234. are always of type \f2atom\fP.
  1235. \f2time\fP is an integer or the symbol \f5now\fP.
  1236. \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2border-width\fP,
  1237. \f2x-root\fP, \f2y-root\fP, \f2count\fP, \f2major-code\fP, \f2minor-code\fP,
  1238. and \f2keycode\fP are integers.
  1239. \f2state\fP is a list of symbols (\f5shift\fP, \f5lock\fP, \f5control\fP,
  1240. \f5mod1\fP .. \f5mod5\fP, \f5button1\fP .. \f5button5\fP).
  1241. \f2button\fP is one of the symbols \f5button1\fP .. \f5button5\fP,
  1242. \f2button-mask\fP is a list of one or more of these symbols.
  1243. \f2cross-mode\fP is a symbol (\f5normal\fP, \f5grab\fP, \f5ungrab\fP).
  1244. \f2place\fP is a symbol (\f5top\fP or \f5bottom\fP).
  1245. .
  1246. .IP "\f3key-press, key-release:\fP"
  1247. .Ix "Event types" key-press
  1248. .Ix "Event types" key-release
  1249. \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP,
  1250. \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2state\fP, \f2keycode\fP,
  1251. \f2same-screen?\fP.
  1252. .
  1253. .IP "\f3button-press, button-release:\fP"
  1254. .Ix "Event types" button-press
  1255. .Ix "Event types" button-release
  1256. \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP,
  1257. \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2state\fP, \f2button\fP,
  1258. \f2same-screen?\fP.
  1259. .
  1260. .IP "\f3motion-notify:\fP"
  1261. .Ix "Event types" motion-notify
  1262. \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP,
  1263. \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2state\fP, \f2is-hint?\fP,
  1264. \f2same-screen?\fP.
  1265. .
  1266. .IP "\f3enter-notify, leave-notify:\fP"
  1267. .Ix "Event types" enter-notify
  1268. .Ix "Event types" leave-notify
  1269. \f2window\fP, \f2root-window\fP, \f2sub-window\fP, \f2time\fP,
  1270. \f2x\fP, \f2y\fP, \f2x-root\fP, \f2y-root\fP, \f2cross-mode\fP,
  1271. \f2cross-detail\fP (one of the symbols \f5ancestor\fP, \f5virtual\fP,
  1272. \f5inferior\fP, \f5nonlinear\fP, \f5nonlinear-virtual\fP),
  1273. \f2same-screen?\fP, \f2focus?\fP, \f2button-mask\fP.
  1274. .
  1275. .IP "\f3focus-in, focus-out:\fP"
  1276. .Ix "Event types" focus-in
  1277. .Ix "Event types" focus-out
  1278. \f2window\fP, \f2cross-mode\fP, \f2focus-detail\fP (one of the symbols
  1279. \f5ancestor\fP, \f5virtual\fP, \f5inferior\fP, \f5nonlinear\fP,
  1280. \f5nonlinear-virtual\fP, \f5pointer\fP, \f5pointer-root\fP, \f5none\fP).
  1281. .
  1282. .IP "\f3keymap-notify:\fP"
  1283. .Ix "Event types" keymap-notify
  1284. \f2window\fP, \f2keymap\fP (a string of length 32).
  1285. .
  1286. .IP "\f3expose:\fP"
  1287. .Ix "Event types" expose
  1288. \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2count\fP.
  1289. .
  1290. .IP "\f3graphics-expose:\fP"
  1291. .Ix "Event types" graphics-expose
  1292. \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP, \f2count\fP,
  1293. \f2major-code\fP, \f2minor-code\fP.
  1294. .
  1295. .IP "\f3no-expose:\fP"
  1296. .Ix "Event types" no-expose
  1297. \f2window\fP, \f2major-code\fP, \f2minor-code\fP.
  1298. .
  1299. .IP "\f3visibility-notify:\fP"
  1300. .Ix "Event types" visibility-notify
  1301. \f2window\fP, \f2visibility-state\fP (one of the symbols \f5unobscured\fP,
  1302. \f5partially-obscured\fP, \f5fully-obscured\fP).
  1303. .
  1304. .IP "\f3create-notify:\fP"
  1305. .Ix "Event types" create-notify
  1306. \f2parent-window\fP, \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP,
  1307. \f2border-width\fP, \f2override-redirect?\fP.
  1308. .
  1309. .IP "\f3destroy-notify:\fP"
  1310. .Ix "Event types" destroy-notify
  1311. \f2event-window\fP, \f2window\fP.
  1312. .
  1313. .IP "\f3unmap-notify:\fP"
  1314. .Ix "Event types" unmap-notify
  1315. \f2event-window\fP, \f2window\fP, \f2from-configure\fP.
  1316. .
  1317. .IP "\f3map-notify:\fP"
  1318. .Ix "Event types" map-notify
  1319. \f2event-window\fP, \f2window\fP, \f2override-redirect\fP.
  1320. .
  1321. .IP "\f3map-request:\fP"
  1322. .Ix "Event types" map-request
  1323. \f2parent-window\fP, \f2window\fP.
  1324. .
  1325. .IP "\f3reparent-notify:\fP"
  1326. .Ix "Event types" reparent-notify
  1327. \f2event-window\fP, \f2parent-window\fP, \f2window\fP, \f2x\fP, \f2y\fP,
  1328. \f2override-redirect\fP.
  1329. .
  1330. .IP "\f3configure-notify:\fP"
  1331. .Ix "Event types" configure-notify
  1332. \f2event-window\fP, \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP,
  1333. \f2height\fP, \f2border-width\fP, \f2above-window\fP,
  1334. \f2override-redirect?\fP.
  1335. .
  1336. .IP "\f3configure-request:\fP"
  1337. .Ix "Event types" configure-request
  1338. \f2parent-window\fP, \f2window\fP, \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP,
  1339. \f2border-width\fP, \f2above-window\fP, \f2stack-mode\fP (see
  1340. \f2set-window-stack-mode!\fP above), \f2value-mask\fP (an integer).
  1341. .
  1342. .IP "\f3gravity-notify:\fP"
  1343. .Ix "Event types" gravity-notify
  1344. \f2event-window\fP, \f2window\fP, \f2x\fP, \f2y\fP.
  1345. .
  1346. .IP "\f3resize-request:\fP"
  1347. .Ix "Event types" resize-request
  1348. \f2window\fP, \f2width\fP, \f2height\fP.
  1349. .
  1350. .IP "\f3circulate-notify:\fP"
  1351. .Ix "Event types" circulate-notify
  1352. \f2event-window\fP, \f2window\fP, \f2place\fP.
  1353. .
  1354. .IP "\f3circulate-request:\fP"
  1355. .Ix "Event types" circulate-request
  1356. \f2parent-window\fP, \f2window\fP, \f2place\fP.
  1357. .
  1358. .IP "\f3property-notify:\fP"
  1359. .Ix "Event types" property-notify
  1360. \f2window\fP, \f2atom\fP, \f2time\fP, \f2property-state\fP (one of the
  1361. symbols \f5new-value\fP, \f5deleted\fP).
  1362. .
  1363. .IP "\f3selection-clear:\fP"
  1364. .Ix "Event types" selection-clear
  1365. \f2window\fP, \f2selection-atom\fP, \f2time\fP.
  1366. .
  1367. .IP "\f3selection-request:\fP"
  1368. .Ix "Event types" selection-request
  1369. \f2owner-window\fP, \f2requestor-window\fP, \f2selection-atom\fP,
  1370. \f2target-atom\fP, \f2property-atom\fP, \f2time\fP.
  1371. .
  1372. .IP "\f3selection-notify:\fP"
  1373. .Ix "Event types" selection-notify
  1374. \f2requestor-window\fP, \f2selection-atom\fP, \f2target-atom\fP,
  1375. \f2property-atom\fP, \f2time\fP.
  1376. .
  1377. .IP "\f3colormap-notify:\fP"
  1378. .Ix "Event types" colormap-notify
  1379. \f2window\fP, \f2colormap\fP, \f2new?\fP, \f2colormap-installed?\fP.
  1380. .
  1381. .IP "\f3client-message:\fP"
  1382. .Ix "Event types" client-message
  1383. \f2window\fP, \f2message type\fP (an atom), \f2message data\fP
  1384. (a string of length 20, or a vector of 10 or 5 integer numbers,
  1385. or, if the format field of the event is wrong, the format as a
  1386. number).
  1387. .
  1388. .IP "\f3mapping-notify:\fP"
  1389. .Ix "Event types" mapping-notify
  1390. \f2window\fP, \f2request\fP (one of the symbols \f5modifier\fP,
  1391. \f5keyboard\fP, \f5pointer\fP), \f2keycode\fP, \f2count\fP.
  1392. .
  1393. .Ch Inter-Client Communication Functions
  1394. .
  1395. .Pr iconify-window window screen-number
  1396. See \f2XIconifyWindow\fP.
  1397. .
  1398. .Pr withdraw-window window screen-number
  1399. See \f2XWithdrawWindow\fP.
  1400. .
  1401. .Pr reconfigure-wm-window . args
  1402. See \f2XReconfigureWMWindow\fP.
  1403. .LP
  1404. For the format of the arguments see \f2create-window\fP
  1405. .Ix create-window
  1406. above.
  1407. Mandatory attributes are \f2window\fP and \f2screen-number\fP
  1408. (an integer).
  1409. Optional attributes are \f2x\fP, \f2y\fP, \f2width\fP, \f2height\fP
  1410. \f2border-width\fP (integers), \f2sibling\fP (a window), and
  1411. \f2stack-mode\fP (a symbol; one of \f5above\fP, \f5below\fP, \f5top-if\fP,
  1412. \f5bottom-if\fP, \f5opposite\fP).
  1413. .
  1414. .Pr get-text-property window atom
  1415. See \f2XGetTextProperty\fP.
  1416. Returns a text property as a list of strings or #f if the specified property
  1417. does not exist.
  1418. .
  1419. .Pr set-text-property! window value atom
  1420. See \f2XSetTextProperty\fP.
  1421. \f2value\fP is a list holding the items of the text property
  1422. (strings or symbols).
  1423. .
  1424. .Pr wm-protocols window
  1425. See \f2XGetWMProtocols\fP.
  1426. Returns a vector of atoms.
  1427. .
  1428. .Pr set-wm-protocols! window protocols
  1429. See \f2XSetWMProtocols\fP.
  1430. \f2protocols\fP is a vector of atoms.
  1431. .
  1432. .Pr wm-name window
  1433. See \f2XGetTextProperty\fP.
  1434. Returns the WM_NAME property as a list of strings or #f if it does not exist.
  1435. .
  1436. .Pr set-wm-name! window name
  1437. See \f2XSetTextProperty\fP.
  1438. \f2name\fP is a list of strings or symbols.
  1439. .
  1440. .Pr wm-icon-name window
  1441. See \f2XGetTextProperty\fP.
  1442. Returns the WM_ICON_NAME property as a list of strings
  1443. or #f if it does not exist.
  1444. .
  1445. .Pr set-wm-icon-name! window name
  1446. See \f2XSetTextProperty\fP.
  1447. \f2name\fP is a list of strings or symbols.
  1448. .
  1449. .Pr wm-client-machine window
  1450. See \f2XGetTextProperty\fP, \f2XGetWMClientMachine\fP.
  1451. Returns the WM_CLIENT_MACHINE property as a list of strings
  1452. or #f if it does not exist.
  1453. .
  1454. .Pr set-wm-client-machine! window value
  1455. See \f2XSetTextProperty\fP, \f2XSetWMClientMachine\fP.
  1456. \f2value\fP is a list of strings or symbols.
  1457. .
  1458. .Pr wm-class window
  1459. See \f2XGetClassHint\fP.
  1460. Returns a pair (name and class) each component of which is either
  1461. a string or #f.
  1462. .
  1463. .Pr set-wm-class! window name class
  1464. See\f2 XSetClassHint\fP.
  1465. \f2name\fP and \f2class\fP are strings or symbols.
  1466. .
  1467. .Pr wm-command window
  1468. See \f2XGetCommand\fP (in X11 Release 4 or newer releases).
  1469. Returns the value of the WM_COMMAND property of the given window
  1470. as a list of strings.
  1471. .
  1472. .Pr set-wm-command! window command
  1473. See \f2XSetCommand\fP.
  1474. \f2command\fP is a list; each element is either a string or a symbol.
  1475. .
  1476. .Pr transient-for window
  1477. See \f2XGetTransientForHint\fP.
  1478. Returns a window.
  1479. .
  1480. .Pr set-transient-for! window property-window
  1481. See \f2XSetTransientForHint\fP.
  1482. .
  1483. .Pr wm-normal-hints window
  1484. See \f2XGetWMSizeHints\fP.
  1485. Returns a list of hints.
  1486. Each element is set to the empty list if the corresponding hint
  1487. has not been set for the specified window.
  1488. .LP
  1489. The elements of the list correspond to the following hints
  1490. (in this order): \f2x\fP, \f2y\fP, \f2width\fP, and \f2height\fP
  1491. (program specified); \f2x\fP, \f2y\fP, \f2width\fP and \f2height\fP
  1492. (user specified); \f2min-width\fP and \f2min-height\fP; \f2max-width\fP
  1493. and \f2max-height\fP; \f2width-inc\fP and \f2height-inc\fP;
  1494. \f2min-aspect-x\fP, \f2min-aspect-y\fP, \f2max-aspect-x\fP and
  1495. \f2max-aspect-y\fP; \f2base-width\fP and \f2base-height\fP;
  1496. and \f2gravity\fP.
  1497. All elements are integers except for the value of \f2gravity\fP
  1498. which is a symbol (see the \f2window-gravity\fP
  1499. .Ix window-gravity
  1500. procedure above).
  1501. .
  1502. .Pr set-wm-normal-hints! . args
  1503. See \f2XSetWMSizeHints\fP.
  1504. For the format of the arguments see \f2create-window\fP
  1505. .Ix create-window
  1506. above.
  1507. Attributes are \f2window\fP (mandatory) and the names of the hints
  1508. listed under \f2wm-normal-hints\fP
  1509. .Ix wm-normal-hints
  1510. above.
  1511. .
  1512. .Pr wm-hints window
  1513. See \f2XGetWMHints\fP.
  1514. Returns a list of hints.
  1515. Each element is set to the empty list if the corresponding hint
  1516. has not been set for the specified window.
  1517. .LP
  1518. The elements of the list correspond to the following hints
  1519. (in this order): \f2input?\fP, \f2initial-state\fP, \f2icon-pixmap\fP,
  1520. \f2icon-window\fP, \f2icon-x\fP, \f2icon-y\fP, \f2icon-mask\fP,
  1521. and \f2window-group\fP.
  1522. The value of \f2input?\fP is a boolean.
  1523. \f2initial-state\fP is a symbol (\f5dont-care\fP, \f5normal\fP, \f5zoom\fP,
  1524. \f5iconic\fP, \f5inactive\fP).
  1525. The values of \f2icon-pixmap\fP and \f2icon-mask\fP are pixmaps.
  1526. \f2icon-window\fP and \f2window-group\fP are windows.
  1527. \f2icon-x\fP and \f2icon-y\fP are integers.
  1528. .
  1529. .Pr set-wm-hints! . args
  1530. See \f2XSetWMHints\fP.
  1531. For the format of the arguments see \f2create-window\fP
  1532. .Ix create-window
  1533. above.
  1534. Attributes are \f2window\fP (mandatory) and the names of the hints
  1535. listed under \f2wm-hints\fP
  1536. .Ix wm-hints
  1537. above.
  1538. .
  1539. .Pr icon-sizes window
  1540. See \f2XGetIconSizes\fP.
  1541. Returns a vector of lists of six integers (\f2min-width\fP, \f2min-height\fP,
  1542. \f2max-width\fP, \f2max-height\fP, \f2width-inc\fP, and \f2height-inc\fP).
  1543. .
  1544. .Pr set-icon-sizes! window icon-sizes
  1545. See \f2XSetIconSizes\fP.
  1546. \f2icon-sizes\fP is a vector of lists of six integers (see \f2icon-sizes\fP
  1547. .Ix icon-sizes
  1548. above).
  1549. .
  1550. .Ch Keyboard Utility Functions
  1551. .
  1552. .Pr display-min-keycode display
  1553. .Up
  1554. .Pr display-max-keycode display
  1555. Returns the minimum/maximum keycode (an integer) for the given display.
  1556. .
  1557. .Pr display-keysyms-per-keycode display
  1558. Returns the number of keysyms per keycode for the given display.
  1559. .
  1560. .Pr string\(mi>keysym string
  1561. See \f2XStringToKeysym\fP.
  1562. \f2string\fP is a string or a symbol.
  1563. Returns an integer if \f2XStringToKeysym\fP succeeds, #f otherwise.
  1564. .
  1565. .Pr keysym\(mi>string keysym
  1566. See \f2XKeysymToString\fP.
  1567. \f2keysym\fP is an integer.
  1568. Returns #f if \f2XKeysymToString\fP fails.
  1569. .
  1570. .Pr keycode\(mi>keysym display keycode index
  1571. See \f2XKeycodeToKeysym\fP.
  1572. \f2keycode\fP and \f2index\fP are integers.
  1573. .
  1574. .Pr keysym\(mi>keycode display keysym
  1575. See \f2XKeysymToKeycode\fP.
  1576. \f2keysym\fP is an integer.
  1577. .
  1578. .Pr lookup-string display keycode mask
  1579. See \f2XLookupString\fP.
  1580. \f2keycode\fP is an integer.
  1581. \f2mask\fP is a list of symbols (\f5shift\fP, \f5lock\fP, \f5control\fP,
  1582. \f5mod1\fP .. \f5mod5\fP, \f5button1\fP .. \f5button5\fP,
  1583. or \f5any-modifier\fP).
  1584. .
  1585. .Pr rebind-keysym display keysym modifiers string
  1586. See \f2XRebindKeysym\fP.
  1587. \f2keysym\fP is an integer.
  1588. \f2modifiers\fP is a vector of integers.
  1589. .
  1590. .Pr refresh-keyboard-mapping window type
  1591. See \f2XRefreshKeyboardMapping\fP.
  1592. \f2type\fP is a symbol (\f5modifier\fP, \f5keyboard\fP, or \f5pointer\fP).
  1593. Invokes \f2XRefreshKeyboardMapping\fP with a faked event structure holding
  1594. the specified window and request type.
  1595. .
  1596. .Ch Other Utility Functions
  1597. .
  1598. .Pr xlib-release-4-or-later?
  1599. Returns always #t.
  1600. .
  1601. .Pr xlib-release-5-or-later?
  1602. Returns #t iff the Xlib extension is linked together with the X11
  1603. Release 5 Xlib or later versions of the Xlib.
  1604. .
  1605. .Pr get-default display program option
  1606. See \f2XGetDefault\fP.
  1607. \f2program\fP and \f2option\fP are strings or symbols.
  1608. Returns a string of #f if the option does not exist for the
  1609. specified program.
  1610. .
  1611. .Pr resource-manager-string display
  1612. See \f2XResourceManagerString\fP.
  1613. Returns a string or #f if the RESOURCE_MANAGER property does not
  1614. exist on the root window.
  1615. .
  1616. .Pr parse-geometry string
  1617. See \f2XParseGeometry\fP.
  1618. Returns a list of six elements: two booleans indicating whether x or
  1619. or y are negative and four integers (x, y, width, and height).
  1620. Each of the elements can be #f to indicate that the respective
  1621. value was not found in the string.
  1622. .
  1623. .Pr parse-color colormap string
  1624. See \f2XParseColor\fP.
  1625. Returns an object of type \f2color\fP or #f if \f2XParseColor\fP fails.
  1626. .
  1627. .Pr store-buffer display bytes buffer
  1628. See \f2XStoreBuffer\fP.
  1629. \f2bytes\fP is a string; \f2buffer\fP is an integer between 0 and 7.
  1630. .
  1631. .Pr store-bytes display bytes
  1632. See \f2XStoreBytes\fP.
  1633. \f2bytes\fP is a string.
  1634. .
  1635. .Pr fetch-buffer display buffer
  1636. See \f2XFetchBuffer\fP.
  1637. \f2buffer\fP is an integer between 0 and 7.
  1638. Returns a string.
  1639. .
  1640. .Pr fetch-bytes display
  1641. See \f2XFetchBytes\fP.
  1642. Returns a string.
  1643. .
  1644. .Pr rotate-buffers display delta
  1645. See \f2XRotateBuffers\fP.
  1646. \f2delta\fP is an integer (the amount to rotate the buffers).
  1647. .
  1648. .Sy with object . body-forms
  1649. \f2object\fP must be a drawable, a graphics context, or a font.
  1650. The \f2body-forms\fP are evaluated in order; \f2with\fP returns the value
  1651. of the last body-form.
  1652. .LP
  1653. Within the scope of the \f2with\fP, the first call to an accessor
  1654. function accessing \f2object\fP (such as \f5window-\fP\f2attribute\fP
  1655. or \f5font-\fP\f2attribute\fP) causes the result of the corresponding
  1656. Xlib function to be retained in a cache; subsequent calls just return
  1657. the value from the cache.
  1658. Likewise, calls to Xlib functions for mutator functions modifying
  1659. \f2object\fP (such as \f5set-window-\fP\f2attribute\fP\f5!\fP)
  1660. are delayed until exit of the \f2with\fP body or until an accessor
  1661. function is called and the cached data for this accessor function
  1662. has been invalidated by the call to a mutator function.
  1663. .
  1664. .Ch Server Extension Functions
  1665. .
  1666. .Pr list-extensions display
  1667. See \f2XListExtensions\fP.
  1668. Returns a vector of strings.
  1669. .
  1670. .Pr query-extension display name
  1671. See \f2XQueryExtension\fP.
  1672. \f2name\fP is a string or a symbol.
  1673. Returns a list of three elements: the major opcode (an integer) or #f
  1674. if the extension has no major opcode, the base event type code (an
  1675. integer) of #f if the extension has no additional event types, and
  1676. the base error code (an integer) of #f if the extension has no
  1677. additional error codes.
  1678. \f2query-extension\fP returns #f if the specified extension is not present.
  1679. .
  1680. .Ch Error Handling
  1681. .
  1682. .Va x-error-handler
  1683. See \f2XSetErrorHandler\fP.
  1684. If an error event is received and the global variable \f2x-error-handler\fP
  1685. is bound to a compound procedure, this procedure is invoked with the
  1686. following arguments: a display, the serial number of the failed request
  1687. (an integer), the error code (either an integer or one of the symbols
  1688. \f5bad-request\fP, \f5bad-value\fP, \f5bad-window\fP, \f5bad-pixmap\fP, 
  1689. \f5bad-atom\fP, \f5bad-cursor\fP, \f5bad-font\fP, \f5bad-match\fP, 
  1690. \f5bad-drawable\fP, \f5bad-access\fP, \f5bad-alloc\fP, \f5bad-color\fP, 
  1691. \f5bad-gcontext\fP, \f5bad-id-choice\fP, \f5bad-name\fP, \f5bad-length\fP, 
  1692. or \f5bad-implementation\fP), the major and minor op-code of the
  1693. failed request (integers), and a resource-ID (an integer).
  1694. .LP
  1695. If an error event is received and this variable is not bound to a
  1696. compound procedure, the Xlib default error handler is invoked.
  1697. The initial value of this variable is the empty list.
  1698. .
  1699. .Va x-fatal-error-handler
  1700. See \f2XSetIOErrorHandler\fP.
  1701. If a fatal I/O error occurs and the global variable
  1702. \f2x-fatal-error-handler\fP is bound to a compound procedure, this
  1703. procedure is invoked with a display as argument.
  1704. The procedure must invoke \f2exit\fP.
  1705. If a fatal error occurs and this variable is not bound to a
  1706. compound procedure, or if the procedure returns, the Xlib default
  1707. fatal error handler is invoked and the interpreter terminates with
  1708. an exit code of 1.
  1709. The initial value of this variable is the empty list.
  1710. .
  1711. .Ch Interaction with the Garbage Collector
  1712. .
  1713. .PP
  1714. .Ix "garbage collector"
  1715. The Scheme garbage collector destroys objects of type \f2colormap\fP,
  1716. \f2cursor\fP, \f2display\fP, \f2font\fP, \f2gcontext\fP, \f2pixmap\fP,
  1717. or \f2window\fP that are not longer accessible from within the Scheme
  1718. program.
  1719. This is done by invoking the function \f2free-colormap\fP, \f2free-cursor\fP,
  1720. \f2close-display\fP, \f2close-font\fP, \f2free-gcontext\fP,
  1721. \f2free-pixmap\fP, or \f2destroy-window\fP, respectively, with the
  1722. object to be destroyed as an argument.
  1723. .PP
  1724. The garbage collector only destroys objects that have been created
  1725. from with the Scheme program (by functions like \f2create-pixmap\fP
  1726. or \f2open-display\fP).
  1727. Objects that have been obtained from the Xlib through functions like
  1728. \f2display-default-colormap\fP (and are owned by the Xlib internals),
  1729. are ignored by the garbage collector.
  1730. .PP
  1731. Programmers must make sure that an object is accessible during the object's
  1732. entire lifetime, otherwise future runs of the garbage collector can
  1733. result in undesired termination of the object.
  1734. One must be especially careful when results of functions that create
  1735. new objects (such as \f2create-window\fP) are ignored or assigned
  1736. to local variables as in
  1737. .Ss
  1738. (define dpy (open-display))
  1739. (define root (display-root-window dpy))
  1740. .sp .5
  1741. (do ((x 0 (+ x 10)) (y 0 (+ y 10))) ((= x 50))
  1742.   (let ((win
  1743.           (create-window 'parent root 'x x 'y y 'width 20 'height 20)))
  1744.     (manage-window win)))
  1745. .Se
  1746. .PP
  1747. In this example, after termination of the do-loop, the garbage
  1748. collector will destroy the newly created windows, as they are not
  1749. accessible from within the program.
  1750. If this is not desired, the windows could be put into a variable (for
  1751. instance, be \f2consed\fP into a list) that is defined outside of the
  1752. body of the loop.
  1753.